Conversation
…returns a corrupted routine revision if the revision has a zero valued input in the configuration
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2470 +/- ##
=======================================
Coverage 48.86% 48.86%
=======================================
Files 191 191
Lines 26152 26152
=======================================
+ Hits 12778 12779 +1
+ Misses 13374 13373 -1
🚀 New features to boost your workflow:
|
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request correctly fixes a bug where a routine revision with a zero-valued input would be parsed incorrectly. The change ensures that the presence of the value field is checked instead of its truthiness. A unit test is added to cover this case. My review includes a suggestion to apply a similar fix for timeseries inputs to prevent a potential bug with empty sourceExternalId values, along with a corresponding test case.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request addresses a bug in deserializing simulator routine revisions, specifically when an input has a zero value or a time series has an empty external ID. The fix correctly checks for the presence of keys rather than their truthiness, which is the right approach. The new tests validate this fix effectively. I have one suggestion to further improve the robustness of the deserialization logic by adding an explicit check for ambiguous inputs, which would make the client more resilient.
|
@haakonvt the tests are failing because of this: tests/tests_integration/test_api/test_workflows.py::TestWorkflowTriggers::test_trigger_run_history This should be unrelated to this PR |
Description
client.simulators.routines.revisions.list or retrieve no longer returns a corrupted routine revision if the revision has a zero valued input or empty time series external ID in the configuration
Checklist:
If a new method has been added it should be referenced in cognite.rst in order to generate docs based on its docstring.